from building import *
import os


Import("BUILD_DIR")
CWD = GetCurrentDir()


objs = Glob("*.c")
objsEx = Glob("example/*.c")


call=None
@register_os
class LibraryVFS(Library):

    def config(self):
        self.source = objs
        self.include += [CWD]
        self.CPPPATH = ["$INFRAS"]
        self.LIBS += ["Device", "MemPool", "Heap"]
        if os.getenv("DISABLE_VFS_FATFS") != "YES":
            self.LIBS += ["FatFS"]
            self.Append(CPPDEFINES=["USE_FATFS"])
        if os.getenv("DISABLE_VFS_LWEXT4") != "YES":
            self.LIBS += ["LwExt4"]
            self.Append(CPPDEFINES=["USE_LWEXT4"])
        if IsBuildForHost(self.GetCompiler()):
            self.source += objsEx
